Skip to content

feature (jetbrains): add plugin pre-installation support#772

Open
Harsh9485 wants to merge 32 commits intocoder:mainfrom
Harsh9485:Pre-install-jetBrains-Plugins-Support-(InstallPlugins)
Open

feature (jetbrains): add plugin pre-installation support#772
Harsh9485 wants to merge 32 commits intocoder:mainfrom
Harsh9485:Pre-install-jetBrains-Plugins-Support-(InstallPlugins)

Conversation

@Harsh9485
Copy link
Copy Markdown
Contributor

@Harsh9485 Harsh9485 commented Feb 28, 2026

Description

Adds a jetbrains_plugins parameter to the JetBrains module.
This parameter accepts a map of JetBrains Marketplace plugin IDs and installs them automatically when the workspace restarts.

Approach

  1. Store plugin IDs in $HOME/.config/jetbrains/plugins.json
  2. First, check whether the IDE is installed. If not, the script exits.
  3. If the IDE is installed, the script checks whether the plugins are already installed. If all plugins are already installed, the script checks for other IDEs. If the user adds new plugins, the script installs only those plugins. Otherwise, the script installs all plugins using the IDE CLI tool with installPlugins.

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/jetbrains
New version: v1.4.0
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

/claim #208

@Harsh9485
Copy link
Copy Markdown
Contributor Author

@DevelopmentCats @matifali, PR is ready for review.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Screenshot 2026-02-28 100141 Screenshot 2026-02-28 100155 Screenshot 2026-02-28 100541 Screenshot 2026-02-28 114817

@Harsh9485
Copy link
Copy Markdown
Contributor Author

@DevelopmentCats, I can’t open any IDE because my trial is over. Could you please check this?

Screenshot 2026-02-28 111440

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@DevelopmentCats, I can’t open any IDE because my trial is over. Could you please check this?

Screenshot 2026-02-28 111440

Yeah I will go ahead and test this out.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Hey @DevelopmentCats, just checking if there are any updates on the testing progress for this PR.

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@Harsh9485

After testing this I get the following behavior with the module.

When you start the workspace the plugins do not install as expected. -> When restarting the workspace everything restarts and the script catches that I have installed one of the IDE's in the workspace but continues to wait for ALL of the rest of the IDE's to be installed. -> The agent remains unhealthy and never makes connection with the workspace and sits in an error state.

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@Harsh9485

I feel as if I should probably elaborate a bit more on the experience I was getting with the module.

I have a template with 2 plugins per Every Jetbrains IDE, and I am only opening one of them at a time since its not realistic to install every IDE in a single workspace. The 2 plugins appear to install, but there is no logic for what the module should do for the remaining plugins aside from just waiting the 60 minutes, and the workspace never going healthy.

Im honestly not sure if the 60 second loop for waiting for the IDE to be ready is necessary since we are warning now that the IDE's need to be pre installed into the workspace or installed and the workspace restarted.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Harsh9485 commented Mar 10, 2026

@DevelopmentCats

I tested it, and after fixing the problem, my old workspace works fine now. I also added some new features.

First, check_plugins_installed():
This checks whether the plugins are already installed or not. If there are any new plugins, the function returns only the new plugin IDs, so the install function does not run unnecessarily.

Second, mark_plugins_installed():
After installing the plugins, it creates a file named $code_installed.json and adds the plugin IDs to it, so check_plugins_installed() can use that file.

Screenshot 2026-03-10 193800 Screenshot 2026-03-10 193819 Screenshot 2026-03-10 193847

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Now I will test this module in a new workspace.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Harsh9485 commented Mar 10, 2026

@DevelopmentCats

I tested it and now it works. I also solved the waiting problem. Now you can test it.

Let me know if you need any information regarding the code.

Screenshot 2026-03-10 202723

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

DevelopmentCats commented Mar 10, 2026

@Harsh9485

On Retest:

  • The Logs are being duplicated in the log file. Every line is print into logs twice.
  • Currently with the way Install_Plugins works in Jetbrains, these are imported as alien_plugin and are disabled by default. I would either account for this and ensure they are not disabled after installation, or make sure to add a warning that these are disabled by default due to jetbrains security defaults.

Other than that this works great, I just almost think that because of the required restart to install the plugins after manually triggering the client to install in the workspace. This feels almost like more work then just finding and installing the plugin in the IDE's. Although in its current state there isn't much to be done about that.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

@Harsh9485

On Retest:

  • The Logs are being duplicated in the log file. Every line is print into logs twice.
  • Currently with the way Install_Plugins works in Jetbrains, these are imported as alien_plugin and are disabled by default. I would either account for this and ensure they are not disabled after installation, or make sure to add a warning that these are disabled by default due to jetbrains security defaults.

Other than that this works great, I just almost think that because of the required restart to install the plugins after manually triggering the client to install in the workspace. This feels almost like more work then just finding and installing the plugin in the IDE's. Although in its current state there isn't much to be done about that.

@DevelopmentCats

I fixed the duplicate log issue.

Are all plugins disabled by default? I remember that the plugins were enabled, and only the plugins that require dependency plugins were disabled. But if the plugins are disabled by default, then I will add a warning to the README file.

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@Harsh9485
On Retest:

  • The Logs are being duplicated in the log file. Every line is print into logs twice.
  • Currently with the way Install_Plugins works in Jetbrains, these are imported as alien_plugin and are disabled by default. I would either account for this and ensure they are not disabled after installation, or make sure to add a warning that these are disabled by default due to jetbrains security defaults.

Other than that this works great, I just almost think that because of the required restart to install the plugins after manually triggering the client to install in the workspace. This feels almost like more work then just finding and installing the plugin in the IDE's. Although in its current state there isn't much to be done about that.

@DevelopmentCats

I fixed the duplicate log issue.

Are all plugins disabled by default? I remember that the plugins were enabled, and only the plugins that require dependency plugins were disabled. But if the plugins are disabled by default, then I will add a warning to the README file.

Let me double check with some different plugins, and I will follow up shortly with the results

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@Harsh9485
On Retest:

  • The Logs are being duplicated in the log file. Every line is print into logs twice.
  • Currently with the way Install_Plugins works in Jetbrains, these are imported as alien_plugin and are disabled by default. I would either account for this and ensure they are not disabled after installation, or make sure to add a warning that these are disabled by default due to jetbrains security defaults.

Other than that this works great, I just almost think that because of the required restart to install the plugins after manually triggering the client to install in the workspace. This feels almost like more work then just finding and installing the plugin in the IDE's. Although in its current state there isn't much to be done about that.

@DevelopmentCats
I fixed the duplicate log issue.
Are all plugins disabled by default? I remember that the plugins were enabled, and only the plugins that require dependency plugins were disabled. But if the plugins are disabled by default, then I will add a warning to the README file.

Let me double check with some different plugins, and I will follow up shortly with the results

I think you are right here. It might have been a specific plugin that I was installing that was just being determined as an alien plugin. The plugins install fine and are activated, unless they are Freemium or require some kind of prereq before being enabled which is just Jetbrains.

The logs look a lot better as well, and I have tested this with all the IDE's I will give this one more final look over and approve it, and then we should be good to go.

>
> 1. Requires JetBrains Toolbox to be installed
> 2. Requires jq to be available
> 3. Only works on Debian/Ubuntu-based systems (due to apt-get usage)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Harsh9485

Can we make this compatible with all distributions rather than Debian/Ubuntu ones?

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Harsh9485 commented Mar 21, 2026

@DevelopmentCats @matifali

I removed the incompatible and unnecessary code, and I tested it in Docker (Ubuntu). Now the script is compatible with all Linux distributions.

I think the PR is ready to merge.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

@DevelopmentCats, could you test the new changes? The script is now compatible.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

@DevelopmentCats, please don’t test this module right now. I’m not sure why the install_plugins script in the Coder workspace didn’t update. I tested it earlier and it worked, but now I’m testing the updated script

Screenshot 2026-03-25 112503

@Harsh9485
Copy link
Copy Markdown
Contributor Author

I tested it, and it works.

@DevelopmentCats, you can test it now.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

@DevelopmentCats

Here are the test screenshots and logs:

log file : file

Screenshot 2026-03-30 211205 Screenshot 2026-03-30 210959

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Hey @DevelopmentCats, this issue has been open for more than a month, so could you please review the PR or ask someone to review and test it?

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

Hey @DevelopmentCats, this issue has been open for more than a month, so could you please review the PR or ask someone to review and test it?

I apologize, for the wait on this, the CI is still failing for this PR which still need to be resolved, but I will test this out again, and update. We were waiting for some input from a jetbrain's dev on this logic, which is why it has taken a bit more than usal here.

@Harsh9485
Copy link
Copy Markdown
Contributor Author

Hey @DevelopmentCats, this issue has been open for more than a month, so could you please review the PR or ask someone to review and test it?

I apologize, for the wait on this, the CI is still failing for this PR which still need to be resolved, but I will test this out again, and update. We were waiting for some input from a jetbrain's dev on this logic, which is why it has taken a bit more than usal here.

@DevelopmentCats
I’ve resolved the conflicts. Please take another look.

Comment on lines +4 to +7
LOGFILE="$HOME/.config/Jetbrains/install_plugins.log"
TOOLBOX_BASE="$HOME/.local/share/JetBrains/Toolbox/apps"
PLUGIN_MAP_FILE="$HOME/.config/Jetbrains/plugins.json"
PLUGIN_ALREADY_INSTALLED_MAP="$HOME/.config/Jetbrains"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LOGFILE="$HOME/.config/Jetbrains/install_plugins.log"
TOOLBOX_BASE="$HOME/.local/share/JetBrains/Toolbox/apps"
PLUGIN_MAP_FILE="$HOME/.config/Jetbrains/plugins.json"
PLUGIN_ALREADY_INSTALLED_MAP="$HOME/.config/Jetbrains"
LOGFILE="$HOME/.config/JetBrains/install_plugins.log"
TOOLBOX_BASE="$HOME/.local/share/JetBrains/Toolbox/apps"
PLUGIN_MAP_FILE="$HOME/.config/JetBrains/plugins.json"
PLUGIN_ALREADY_INSTALLED_MAP="$HOME/.config/JetBrains"

Should these not all exist in the same folder or is there an issue with them coexisting within the same folder?

Image

@DevelopmentCats
Copy link
Copy Markdown
Collaborator

@Harsh9485 Other than my above comment I have tested everything and it looks good. I will have Atif take a final look at this since he is in charge of the bounties, but thank you for the work, and I apologize for the wait on this.

Copy link
Copy Markdown
Member

matifali commented Apr 3, 2026

@DevelopmentCats lets meet to test this live. I want to be sure we provide a god enough UX as this is one of the most used module responsible for JetBrains integration.

Thanks for your work and patience here Harsh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants